<!DOCTYPE html SYSTEM "about:legacy-compat">
<html lang="en"><head><META http-equiv="Content-Type" content="text/html; charset=iso-8859-15"><title>Apache JMeter
          -
          User's Manual: Building an Extended LDAP Test Plan</title><meta name="viewport" content="width=device-width, initial-scale=1"><link href="http://fonts.googleapis.com/css?family=Merriweather:400normal" rel="stylesheet" type="text/css"><link rel="stylesheet" type="text/css" href="../css/new-style.css"></head><body role="document"><a href="#content" class="hidden">Main content</a><div class="header"><!--
            APACHE LOGO
          --><div><a href="http://www.apache.org"><img title="Apache Software Foundation" width="290" height="75" src="../images/asf-logo.png" alt="Logo ASF"></a></div><!--
              PROJECT LOGO
            --><div><a href="http://jmeter.apache.org/"><img src="../images/logo.jpg" alt="Apache JMeter"></a></div><div class="twitter"><div><a href="https://twitter.com/share" class="twitter-share-button" data-text="Powerful Load Testing with Apache #JMeter" data-via="ApacheJMeter" data-lang="en-gb" data-size="large">Tweet</a><script>
            (function(d,s,id){
              var js,
                  fjs=d.getElementsByTagName(s)[0],
                  p=/^http:/.test(d.location)?'http':'https';
              if (!d.getElementById(id)) {
                  js=d.createElement(s);
                  js.id=id;
                  js.src=p+'://platform.twitter.com/widgets.js';
                  fjs.parentNode.insertBefore(js,fjs);
              }
            })(document, 'script', 'twitter-wjs');
              </script></div><div><a href="https://twitter.com/ApacheJMeter" class="twitter-follow-button" data-show-count="false" data-lang="en-gb" data-size="large">Follow</a><script>(function(d,s,id){
                var js,
                    fjs=d.getElementsByTagName(s)[0],
                    p=/^http:/.test(d.location)?'http':'https';
                if (!d.getElementById(id)) {
                    js=d.createElement(s);
                    js.id=id;
                    js.src=p+'://platform.twitter.com/widgets.js';
                    fjs.parentNode.insertBefore(js,fjs);
                }
            })(document, 'script', 'twitter-wjs');
              </script></div></div><div class="banner"><iframe src="http://www.apache.org/ads/bannerbar.html" style="border-width:0;" frameborder="0" scrolling="no"></iframe><div class="clear"></div></div></div><div class="nav"><ul class="menu"><li><div class="menu-title">About</div><ul><li><a href="../index.html">Overview</a></li><li><a href="http://twitter.com/ApacheJMeter">JMeter on Twitter<img src="../images/twitter.png" alt="Icon for JMeter on Twitter"></a></li><li><a href="../issues.html">Issue Tracking</a></li><li><a href="http://projects.apache.org/feeds/rss/jmeter.xml">Subscribe to What's New</a></li><li><a href="http://www.apache.org/licenses/">License</a></li></ul></li></ul><ul class="menu"><li><div class="menu-title">Download</div><ul><li><a href="../download_jmeter.cgi">Download Releases</a></li><li><a href="../nightly.html">Developer (Nightly) Builds</a></li></ul></li></ul><ul class="menu"><li><div class="menu-title">Documentation</div><ul><li><a href="../changes.html">Changes per version</a></li><li><a href="../usermanual/get-started.html">Get Started</a></li><li><a href="../usermanual/index.html">User Manual</a></li><li><a href="../usermanual/best-practices.html">Best Practices</a></li><li><a href="../usermanual/component_reference.html">Component Reference</a></li><li><a href="../usermanual/functions.html">Functions Reference</a></li><li><a href="../api/index.html">Javadocs</a></li><li><a href="../building.html">Building JMeter and Add-Ons</a></li><li><a href="http://wiki.apache.org/jmeter">JMeter Wiki</a></li><li><a href="http://wiki.apache.org/jmeter/JMeterFAQ">FAQ (Wiki)</a></li></ul></li></ul><ul class="menu"><li><div class="menu-title">Tutorials (PDF format)</div><ul><li><a href="../usermanual/jmeter_distributed_testing_step_by_step.pdf">Distributed Testing</a></li><li><a href="../usermanual/jmeter_proxy_step_by_step.pdf">Recording Tests</a></li><li><a href="../usermanual/junitsampler_tutorial.pdf">JUnit Sampler</a></li><li><a href="../usermanual/jmeter_accesslog_sampler_step_by_step.pdf">Access Log Sampler</a></li><li><a href="../extending/jmeter_tutorial.pdf">Extending JMeter</a></li></ul></li></ul><ul class="menu"><li><div class="menu-title">Community</div><ul><li><a href="http://wiki.apache.org/jmeter/JMeterCommitters">Contributors</a></li><li><a href="../mail.html">Mailing Lists</a></li><li><a href="../svnindex.html">SVN Repositories</a></li></ul></li></ul><ul class="menu"><li><div class="menu-title">Foundation</div><ul><li><a href="http://www.apache.org/">ASF</a></li><li><a href="http://www.apache.org/foundation/getinvolved.html">Get Involved in the ASF</a></li><li><a href="http://www.apache.org/foundation/sponsorship.html">Sponsorship</a></li><li><a href="http://www.apache.org/foundation/thanks.html">Thanks</a></li></ul></li></ul></div><div class="main" id="content"><ul class="pagelinks"><li><a href="build-ldap-test-plan.html">&lt; Prev</a></li><li><a href="../index.html">Index</a></li><li><a href="build-ws-test-plan.html">Next &gt;</a></li></ul><div class="section"><h1 id="ldapexttest">9b. Building an Extended LDAP Test Plan<a class="sectionlink" href="#ldapexttest" title="Link to here">&para;</a></h1>
<p>
In this section, you will learn how to create a basic Test Plan to test an LDAP
server.</p>
<p>
As the Extended LDAP Sampler is highly configurable, this also means that it takes
some time to build a correct testplan. You can however tune it exactly up to your
needs.
</p>

<p>
You will create four users that send requests for four tests on the LDAP server. Also, you will tell
the users to run their tests one time. So,  the total number of requests is (1 users) x (9 requests) x
repeat 1 time) = 9 LDAP requests. To construct the Test Plan, you will use the following elements:<br>
<a href="test_plan.html#thread_group">Thread Group</a>,<br>
<a href="../usermanual/component_reference.html#Adding_LDAP_Extended_Request_Defaults">Adding LDAP Extended Request Defaults</a>,<br>
<a href="../usermanual/component_reference.html#Adding_LDAP_Requests">Adding LDAP Requests</a>, and<br>
<a href="../usermanual/component_reference.html#Adding_a_Listener_to_View/Store_the_Test_Results">Adding a Listener to View/Store the Test Results</a>
</p>
<p>
This example assumes that the LDAP Server is available at ldap.test.com.
</p>
<p>
For the less experienced LDAP users, I build a <a href="ldapops_tutor.html">small
LDAP tutorial</a> which shortly explains
the several LDAP operations that can be used in building a complex testplan.
</p>
<p>
Take care when using LDAP special characters in the distinghuished name, in that case (eg, you want to use a + sign in a
distinghuished name) you need to escape the character by adding an "\" sign before that character.
extra exeption: if you want to add a \ character in a distinguished name (in an add or rename operation), you need to use 4 backslashes.
examples:
cn=dolf\+smits to add/search an entry with the name like cn=dolf+smits
cn=dolf \\ smits to search an entry with the name cn=dolf \ smits
cn=c:\\\\log.txt to add an entry with a name like cn=c:\log.txt
</p>


    <div class="subsection"><h2>9b.1 Adding Users<a class="sectionlink" href="#ext_adding_users" title="Link to here">&para;</a></h2>
<p>
The first step you want to do with every JMeter Test Plan is to add a Thread Group element.
The Thread Group tells JMeter the number of users you want to simulate, how often the users should send
requests, and the how many requests  they should send.
</p>
<p>
Go ahead and add the <b>Thread Group</b> element by first selecting the <b>Test Plan</b>, clicking your
right mouse button to get the <b>Add</b> menu, and then select <b>Add</b>&gt;<b>Threads (Users)</b>&gt;<b>Thread Group</b>. 
You should now see the <b>Thread Group</b> element under <b>Test Plan</b>. If you do not see the element, then "expand" the Test Plan tree by
clicking on the Test Plan element.
</p>
<p>
<figure><a href="../images/screenshots/ldaptest/extthreadgroup.png"><img src="../images/screenshots/ldaptest/extthreadgroup.png" width="" height="" alt="
Figure 9b.1. Thread Group with Default Values"></a><figcaption>
Figure 9b.1. Thread Group with Default Values</figcaption></figure>

</p>
</div>
    <div class="subsection"><h2>9b.2 Adding LDAP Extended Request Defaults<a class="sectionlink" href="#add_ldapext_defaults" title="Link to here">&para;</a></h2>
<p>
Begin by selecting the LDAP Ext Users element. Click your right mouse button
to get the <b>Add</b> menu, and then select <b>Add </b>&gt;<b>Config Element</b>&gt;<b>LDAP Extended Request Defaults</b>. Then,
select this new element to view its Control Panel.
</p>
<p>
Like most JMeter elements, the <b>LDAP Extended Request Defaults</b> Control Panel has a name
field that you can modify. In this example, leave this field with the default value.
</p>
<p><figure><a href="../images/screenshots/ldaptest/extrequestdefaults.png"><img src="../images/screenshots/ldaptest/extrequestdefaults.png" width="" height="" alt="
  Figure 9b.2 LDAP Defaults for our Test Plan"></a><figcaption><br>
  Figure 9b.2 LDAP Defaults for our Test Plan</figcaption></figure>
</p>
<p>
            For each of the different operations, some default values can be filled in.
            In All cases, when a default is filled in, this is used for the LDAP extended requests.
            For each requst, you can override the defaults by filling in the values in the LDAP extended request sampler.
            When no value is entered which is necesarry for a test, the test will fail in an unpredictable way!
            </p>
            We will not enter any default values here, as we will build a very small testplan, so we will explain all the different fields when we add the LDAP Extended samplers.
</div>
<div class="subsection"><h2>9b.3 Adding LDAP Requests<a class="sectionlink" href="#add_extrequests" title="Link to here">&para;</a></h2>
<p>
In our Test Plan, we want to use all 9 LDAP requests.
</p>
   <ol>
<li>
Thread bind
</li>
<li>
Search Test
</li>
<li>
Compare Test
</li>
<li>
Single bind/unbind Test
</li>
<li>
Add Test
</li>
<li>
Modify Test
</li>
<li>
Rename entry (moddn)
</li>
<li>
Delete Test
</li>
<li>
Thread unbind
</li>
</ol>
   <p>
JMeter sends requests in the order that you add them to the tree.
</p>
<p>
Adding a requests always start by:<br>
Adding the <b>LDAP Extended Request</b> to the LDAP Ext Users element (<b>Add</b>&gt;<b>
Sampler</b>&gt;<b>LDAP Ext Request</b>). Then, select the <b>LDAP Ext Request</b> element in the tree
and edit the following properties.</p>


<div class="subsection"><h2>9b.3.1 Adding a Thread bind Request<a class="sectionlink" href="#add_threadbind" title="Link to here">&para;</a></h2>
<p>
   <ol>
<li>
Rename the element: "1. Thread bind" 
</li>
<li>
Select the "Thread bind" button.
</li>
<li>
Enter the hostname value from the LDAP server in the Servername field
</li>
<li>
Enter the portnumber from the LDAP server (636 : ldap over SSL) in the port field
</li>
<li>
<i>(Optional)</i> Enter the baseDN in the DN field, this baseDN will be used as thestarting point for searches, add, deletes etc.<br>
take care that this must be the uppermost shared level for all your request, eg When all information is stored under ou=Users, dc=test, dc=com, you can use this value in the basedn.<br>
</li>
<li>
<i>(Optional)</i> Enter the distinghuised name from the user you want to use for authentication.
When this field is kept empty, an anonymous bind will be established.
</li>
<li>
<i>(Optional)</i> Enter the password for the user you want to authenticate with, an empty password will also lead to an anonymous bind.
</li>
<li>
<i>(Optional)</i> Enter a value for the connection timeout with LDAP
</li>
<li>
<i>(Optional)</i> Check the box Use Secure LDAP Protocol if you access with LDAP over SSL (ldaps)
</li>
</ol>
</p>
<p>
<figure><a href="../images/screenshots/ldaptest/extthreadbind.png"><img src="../images/screenshots/ldaptest/extthreadbind.png" width="" height="" alt="
Figure 9b.3.1. Thread Bind example"></a><figcaption>
Figure 9b.3.1. Thread Bind example</figcaption></figure>
</p>
</div>

<div class="subsection"><h2>9b.3.2 Adding a search Request<a class="sectionlink" href="#add_searchreq" title="Link to here">&para;</a></h2>
<p>
   <ol>
<li>
Rename the element: "2. Search Test" 
</li>
<li>
Select the "Search Test" button.
</li>
<li>
<i>(Optional)</i> enter the searchbase under which you want to perform the search, relative to the basedn, used in the thread bind request.<br>
When left empty, the basedn is used as a search base, this files is important if you want to use a "base-entry" or "one-level" search (see below)
</li>
<li>
Enter the searchfilter, any decent LDAP serach filter will do, but for now, use something simple, like (sn=Doe) or (cn=*)
</li>
<li>
<i>(Optional)</i> Enter the scope in the scope field, it has three options:
     <ol>
     <li>baseobject search<br>only the given searchbase is used, only for checking attributes or existence.
     </li>
     <li>onelevel search<br>Only search in one level below given searchbase is used
     </li>
     <li>subtree search<br> Searches for object at any point below the given basedn
     </li></ol>
</li>
<li>
<i>(Optional)</i> Size limit, specifies the maximun number of returned entries,
</li>
<li>
<i>(Optional)</i> Time limit, specifies the maximum number of miliseconds, the SERVER can use for performing the search. it is NOT the maximun time the application will wait.<br>
When a very large returnset is returned, from a very fast server, over a very slow line, you may have to wait for ages for the completion of the search request, but this parameter will not influence this.
</li>
<li><i>(Optional)</i> Attributes you want in the search answer. This can be used to limit the size of the answer, especially when an onject has very large attributes (like jpegPhoto). There are three possibilities:
<ol><li>Leave empty (the default setting must also be empty) This will return all attributes.
</li>
<li>Put in one empty value (""), it will request a non-existent attributes, so in reality it returns no attributes
</li>
<li>Put in the attributes, seperated by a semi-colon. It will return only the requested attributes
</li></ol></li>
<li>
<i>(Optional)</i> Return object. Checked will return all java-object attributes, it will add these to the requested attributes, as specified above.<br>
Unchecked will mean no java-object attributes will be returned.
</li>
<li>
<i>(Optional)</i> Dereference aliases. Checked will mean it will follow references, Unchecked says it will not.
</li>
<li>
<i>(Optional)</i> Parse the search results?. Checked will mean it gets all results in response data, Unchecked says it will not.
</li>
</ol>
</p>
<p>
<figure><a href="../images/screenshots/ldaptest/extsearch.png"><img src="../images/screenshots/ldaptest/extsearch.png" width="" height="" alt="
Figure 9b.3.2. search request example"></a><figcaption>
Figure 9b.3.2. search request example</figcaption></figure>
</p></div>

<div class="subsection"><h2>9b.3.3 Adding a Compare Request<a class="sectionlink" href="#add_comparereq" title="Link to here">&para;</a></h2>
<p>
   <ol>
<li>
Rename the element: "3. Compare Test" 
</li>
<li>
Select the "Compare" button.
</li>
<li>
enter the entryname form the object on which you want the compare operation to work, relative to the basedn, eg "cn=jdoe,ou=Users"
</li>
<li>
Enter the compare filter, this must be in the form "attribute=value", eg "mail=jdoe@test.com"
</li>
</ol>
</p>
<p>
<figure><a href="../images/screenshots/ldaptest/extcompare.png"><img src="../images/screenshots/ldaptest/extcompare.png" width="" height="" alt="
Figure 9b.3.3. Compare example"></a><figcaption>
Figure 9b.3.3. Compare example</figcaption></figure>
</p>
</div>

<div class="subsection"><h2>9b.3.4 Adding a Single bind/unbind<a class="sectionlink" href="#add_sbind" title="Link to here">&para;</a></h2>
<p>
   <ol>
<li>
Rename the element: "4. Single bind/unbind Test" 
</li>
<li>
Select the "Single bind/unbind" button.
</li>
<li>
Enter the FULL distinghuised name from the user you want to use for authentication.<br>
eg. cn=jdoe,ou=Users,dc=test,dc=com
When this field is kept empty, an anonymous bind will be established.
</li>
<li>
Enter the password for the user you want to authenticate with, an empty password will also lead to an anonymous bind.
</li>
</ol>
<b>Take care</b>: This single bind/unbind is in reality two seperate operations but cannot easily be split!
</p><p>
<figure><a href="../images/screenshots/ldaptest/extsbind.png"><img src="../images/screenshots/ldaptest/extsbind.png" width="" height="" alt="
Figure 9b.3.4. Single bind/unbind example"></a><figcaption>
Figure 9b.3.4. Single bind/unbind example</figcaption></figure>
</p>
</div>

<div class="subsection"><h2>9b.3.5 Adding an Add Request<a class="sectionlink" href="#add_addreq" title="Link to here">&para;</a></h2>
<p>
   <ol>
<li>
Rename the element: "5. Add Test" 
</li>
<li>
Select the "Add" button.
</li>
<li>
Enter the distinghuised name for the object to add, relative to the basedn.
</li>
<li>
Add a line in the "add test" table, fill in the attribute and value.<br>
When you need the same attribute more than once, just add a new line, add the attribute again, and a different value.<br>
All necessary attributes and values must be specified to pass the test, see picture!<br>
(sometimes the server adds the attribute "objectClass=top", this might give a problem.
</li>
</ol>
</p>
<p>
<figure><a href="../images/screenshots/ldaptest/extadd.png"><img src="../images/screenshots/ldaptest/extadd.png" width="" height="" alt="
Figure 9b.3.5. Add request example"></a><figcaption>
Figure 9b.3.5. Add request example</figcaption></figure>
</p>
</div>

<div class="subsection"><h2>9b.3.6 Adding a Modify Request<a class="sectionlink" href="#add_modreq" title="Link to here">&para;</a></h2>
<p>
   <ol>
<li>
Rename the element: "6. Modify Test" 
</li>
<li>
Select the "Modify test" button.
</li>
<li>
Enter the distinghuised name for the object to modify, relative to the basedn.
</li>
<li>
Add a line in the "modify test" table, with the "add" button.
</li>
<li>
You need to enter the attribute you want to modify, (optional) a value, and the opcode. The meaning of this opcode:
<ol><li><b>add</b><br> this will mean that the attribute value (not optional in this case) willbe added to the attribute.<br>
When the attribute is not existing, it will be created and the value added<br>
When it is existing, and defined multi-valued, the new value is added.<br>
when it is existing, but single valued, it will fail.</li>
<li><b>replace</b><br>
This will overwrite the attribute with the given new value (not optional here)<br>
When the attribute is not existing, it will be created and the value added<br>
When it is existing, old values are removed, the new value is added.</li>
<li><b>delete</b><br>
When no value is given, all values will be removed<br>
When a value is given, only that value will be removed<br>
 when the given value is not existing, the test will fail
</li></ol>
</li>
<li>
<i>(Optional)</i> Add more modifications in the "modify test" table.<br>
All modifications which are specified must succeed, to let the modification test pass. When one modification fails, 
NO modifications at all will be made and the entry will remain unchanged.
</li>
</ol>
</p>
<p>
<figure><a href="../images/screenshots/ldaptest/extmod.png"><img src="../images/screenshots/ldaptest/extmod.png" width="" height="" alt="
Figure 9b.3.6. Modify example"></a><figcaption>
Figure 9b.3.6. Modify example</figcaption></figure>
</p>
</div>

<div class="subsection"><h2>9b.3.7 Adding a Rename Request (moddn)<a class="sectionlink" href="#add_moddn" title="Link to here">&para;</a></h2>
<p>
   <ol>
<li>
Rename the element: "7. Rename entry (moddn)" 
</li>
<li>
Select the "Rename Entry" button.
</li>
<li>
Enter the name of the entry, relative to the baseDN, in the "old entry name-Field".<br>
that is, if you want to rename "cn=Little John Doe,ou=Users", and you set the baseDN to "dc=test,dc=com",
you need to enter "cn=John Junior Doe,ou=Users" in the old entry name-field.
</li>
<li>
Enter the new name of the entry, relative to the baseDN, in the "new distinghuised name-Field".<br>
when you only change the RDN, it will simply rename the entry<br>
when you also add a different subtree, eg you change from cn=john doe,ou=Users to cn=john doe,ou=oldusers, it will move the entry.
You can also move a complete subtree (If your LDAP server supports this!), eg ou=Users,ou=retired, to ou=oldusers,ou=users, 
this will move the complete subtee, plus all retired people in the subtree to the new place in the tree.
</li>
</ol>
</p>
<p>
<figure><a href="../images/screenshots/ldaptest/extmoddn.png"><img src="../images/screenshots/ldaptest/extmoddn.png" width="" height="" alt="
Figure 9b.3.8. Rename example"></a><figcaption>
Figure 9b.3.8. Rename example</figcaption></figure>
</p>
</div>

<div class="subsection"><h2>9b.3.8 Adding a Delete Request<a class="sectionlink" href="#add_delreq" title="Link to here">&para;</a></h2>
<p>
   <ol>
<li>
Rename the element: "8. Delete Test" 
</li>
<li>
Select the "Delete" button.
</li>
<li>
Enter the name of the entry, relative to the baseDN, in the Delete-Field.<br>
that is, if you want to remove "cn=John Junior Doe,ou=Users,dc=test,dc=com", and you set the baseDN to "dc=test,dc=com",
you need to enter "cn=John Junior Doe,ou=Users" in the Delete-field.
</li>
</ol>
</p>
<p>
<figure><a href="../images/screenshots/ldaptest/extdel.png"><img src="../images/screenshots/ldaptest/extdel.png" width="" height="" alt="
Figure 9b.3.7. Delete example"></a><figcaption>
Figure 9b.3.7. Delete example</figcaption></figure>
</p>
</div>

<div class="subsection"><h2>9b.3.9 Adding an unbind Request<a class="sectionlink" href="#add_unbind" title="Link to here">&para;</a></h2>
<p>
   <ol>
<li>
Rename the element: 9. Thread unbind" 
</li>
<li>
Select the "Thread unbind" button.
This will be enough as it just closes the current connection.
The information which is needed is already known by the system
</li></ol>
</p>
<p>
<figure><a href="../images/screenshots/ldaptest/extthreadunbind.png"><img src="../images/screenshots/ldaptest/extthreadunbind.png" width="" height="" alt="
Figure 9b.3.9. Unbind example"></a><figcaption>
Figure 9b.3.9. Unbind example</figcaption></figure>
</p>
</div>
</div>

<div class="subsection"><h2>9b.4 Adding a Listener to View/Store the Test Results<a class="sectionlink" href="#add_ldapext_listener" title="Link to here">&para;</a></h2>
<p>
The final element you need to add to your Test Plan is a Listener.
 This element is responsible for storing all of the results of your LDAP
requests in a file  and presenting a visual model of the data.Select the Thread group
element and add a <b>View Results Tree</b> (<b>Add</b>&gt;<b>Listener</b>&gt;<b>View Results Tree</b>)
</p>
<p>
<figure><a href="../images/screenshots/ldaptest/extviewtree.png"><img src="../images/screenshots/ldaptest/extviewtree.png" width="" height="" alt="
Figure 9b.4. View Result Tree Listener"></a><figcaption>
Figure 9b.4. View Result Tree Listener</figcaption></figure>
</p>
<p>
In this listener you have three tabs to view, the sampler result, the request and the response data.
<ol>
<li>
The sampler result just contains the response time, the returncode and return message
</li>
<li>
The request gives a short description of the request that was made, in practice no relevant information
is contained here.
</li>
<li>
The response data contains the full details of the sent request, as well the full details of the received answer,
this is given in a (self defined) xml-style.
<a href="ldapanswer_xml.html">The full description can be found here.</a>
</li>
</ol>
</p>
</div>
</div><ul class="pagelinks"><li><a href="build-ldap-test-plan.html">&lt; Prev</a></li><li><a href="../index.html">Index</a></li><li><a href="build-ws-test-plan.html">Next &gt;</a></li></ul></div><div class="footer"><div class="copyright">
            Copyright &copy;
            1999 &ndash;
            2015
            , Apache Software Foundation
          </div><div class="trademarks">Apache, Apache JMeter, JMeter, the Apache
            feather, and the Apache JMeter logo are
            trademarks of the
            Apache Software Foundation.
          </div></div></body></html>